Method for replacing parts of a digitally coded picture, and device for carrying out the method

ABSTRACT

A method for replacing parts of a digitally coded picture ( 11 ) is proposed. The digitally coded picture ( 11 ) may correspond to a sub-picture which is displayed on the screen of a television set ( 10 ). In the method, each line of the picture ( 11 ) is run length-coded. The replaceable parts of a line of the picture are run length-coded separately. The part which replaces the replaceable, original part of a line of the picture ( 11 ) is run length-coded in such a way that it has the same number of data units (data bytes) as the original part of this line of the picture ( 11 ). The replacement of the data for the run length coding words is carried out in a memory device ( 51 ). The replacement is possible in a simple manner by virtue of the fact that the original part of a line of the picture and the new part of the line of the picture have the same number of data units. Moreover, a device for carrying out the method is also proposed.

The invention relates to a method for replacing parts of a digitallycoded picture and to a device for carrying out the method for replacingparts of a digitally coded picture, in particular a video picture.

PRIOR ART

The invention is based on a method for replacing parts of a digitallycoded picture. In video technology, it is known to provide so-calledsub-picture decoding devices in film playback devices, for example a DVDplayback device, for displaying e.g. subtitles on the screen of atelevision set. DVD playback devices of this type are currentlycommercially available and contain the abovementioned sub-picturedecoding devices. The DVD standard (Version 1.0) provides a number ofexplanations concerning such sub-picture decoding devices, which aredesignated as sub-picture decoders therein. All of the sub-pictures tobe displayed are stored in a special format. In this case, the data ofthe individual pixels are stored in compressed form in a so-calledsub-picture unit (SPU).

INVENTION

A possible way of changing the stored pixel data (PXD) in order toproduce an altered sub-picture is not provided in the standard alreadymentioned. This gives rise to the problem that if frequent changing ofthe sub-pictures is necessary for certain applications, all of thepossible sub-pictures have to be stored individually in the memory, evenif they differ only slightly from one another. This leads to anincreased memory outlay for the sub-pictures.

The object of the invention, therefore, is to specify a method forreplacing parts of a digitally coded picture which enables specificreplacements to be made even in the compressed pixel data of thepreviously described sub-pictures, with the result that the majority ofthe pixel data can remain unchanged and it is not necessary to provide acompletely new sub-picture unit in the memory.

The method according to the invention has the advantage over the methodknown from the prior art that sub-picture units having compressed pixeldata can be altered at least in parts, with the result that changes tothe sub-picture can be effected without the necessity of providing acompletely new sub-picture unit in a memory e.g. of a film playbackdevice. Furthermore, it becomes possible for additional pixel dataeasily to be attached to the replaceable part of the sub-picture, or beinserted, without completely new coding of the pixels of the picturebeing necessary.

Today's customary television standards such as NTSC and PAL employ theknown line interlacing method. In this case, each picture is dividedinto two fields that are interleaved in one another. This is also takeninto account in the production of sub-picture units according to the DVDstandard. A sub-picture is likewise divided into two fields. The pixeldata (PXD) of the lines of each field are stored in separate memoryareas. In this case, it is very advantageous for the method forreplacing parts of the digitally coded picture if the field which iscurrently being decoded and displayed is signalled and a replacement ofparts of the lines of the picture is allowed only in that field which iscurrently not being decoded and displayed. Memory access conflicts andincorrect displays are thereby prevented from the outset.

Advantageous measures for a device for replacing parts of a digitallycoded picture are specified.

DRAWINGS

Exemplary embodiments of the invention are illustrated in the drawingsand are explained in more detail in the following description.

In the figures:

FIG. 1 shows the display of a sub-picture on the screen of a televisionreceiver;

FIG. 2 shows the storage format of a sub-picture unit;

FIG. 3 shows a diagrammatic illustration of the rules for run lengthcoding of the pixel data of a line of a sub-picture;

FIG. 4 shows 4 examples of run length coding employed in picture partsto be replaced;

FIG. 5 shows a diagrammatic illustration of a replacement of a sub-areaof the compressed pixel data of a sub-picture;

FIG. 6 shows a rough block diagram of the device according to theinvention, and

FIG. 7 shows a flow diagram for a program for controlling the deviceaccording to the invention.

DESCRIPTION OF THE INVENTION

The invention is described using the example of a television receiverhaving a sub-picture decoding device for displaying or insertingsub-pictures on the screen of the television receiver. Such a televisionreceiver is illustrated in FIG. 1 and designated by the reference symbol10. A main picture showing a mountain landscape is displayed on thescreen of the television receiver. A sub-picture, which is provided withthe reference symbol 11, is additionally displayed in the top rightcorner on the screen of the television receiver. This sub-picture 11serves to display the current programme location number. The firstprogramme location is illustrated. In the event of a switch-over to adifferent channel, the associated programme location would be displayedas sub-picture 11.

The sub-picture 11 is displayed with the aid of a sub-picture decodingdevice, which is explained in more detail below. This sub-picturedecoding device largely corresponds to a sub-picture decoding device asdisclosed in the DVD standard (Version 1.0). In this regard, therefore,reference is made to this standard in supplementary fashion.

FIG. 2 gives a rough illustration of the data format of a so-calledsub-picture unit (SPU). The reference number 20 designates a data fieldfor a header (SPUH) of the sub-picture unit. The reference number 21designates a data field for the compressed pixel data of a first fieldof the sub-picture (PXDTF), and the reference number 22 correspondinglydesignates a data field for the compressed pixel data (PXDBF) of thesecond field of the sub-picture. Finally, the reference number 23designates a data field for a display control sequence table (SP_DCSQT).So-called display control command sequences (SP_DCSQ) are stored in thedata field 23. The individual display control commands will not bediscussed in detail in this patent application because they areindividually explained with a high degree of accuracy in the DVDstandard (Version 1.0) and these display control command sequences haveno further involvement in the following text.

The pixel data in the data fields 21 and 22 determine the displayedpattern of the sub-picture. For each pixel of a line of the sub-picture,a data word two bits wide in this case specifies whether the pixel is abackground pixel or a foreground pixel or whether the pixel is to behighlighted in a first manner or in a second manner. These fourdistinctions can be made using the two bits. Specifically, these binaryvalues denote: 00=background pixel, 01=foreground pixel, 10=pixeldisplayed with highlighting 1, and 11=pixel displayed with highlighting2.

It must be taken into account, however, that the individual pixel dataare not stored in this pure form in the memory, but rather in compressedform. So-called run length coding is carried out for this purpose. Thisrun length coding method is explained in more detail below withreference to FIG. 3.

Seven coding rules are stipulated for run length coding in the DVDstandard described. The run length coding operates such that arespective line of a field of the sub-picture to be displayed is runlength-coded. The first rule for run length coding is as follows:

-   1. If one to three pixels having the same data word follow one    another in the line, then the number of pixels is entered in the    first two bits of the first run length coding word and the pixel    data word is entered in the succeeding two bits. Four bits are then    regarded as a unit. This is illustrated in the top part of FIG. 3.    The reference number 30 designates the data field for the number of    pixels, which data field has a storage space for two bits. The    reference number 31, on the other hand, designates the data field    for the type of pixels, that is to say the data word of the pixels.    This data field likewise has a length of two bits.

The second rule for run length coding reads as follows:

-   2. If 4 to 15 pixels having the same data word follow one another,    then a 0 is entered in the first two bits of a run length word, and    the number of pixels is entered in the next four bits, and the type    of pixels is again entered in the last two bits. This results in a    run length coding word having a length of 8 bits corresponding to    the second part of FIG. 3.

The third rule for run length coding reads as follows:

-   3. If 16 to 63 pixels having the same value follow one another, then    a 0 is entered in the first four bits of the run length coding word    and the number of pixels is entered in the next six bits that    follow. The type of pixels is again entered in the last two bits.    This produces a run length coding word having a length of 12 bits.    This is illustrated in the middle part of FIG. 3.

The fourth rule for run length coding reads as follows:

-   4. If 64 to 255 pixels having the same value follow one another,    then a 0 is entered in the first six bits of the run length coding    word, and the number of pixels is entered in the following eight bit    positions, and the type of pixels is entered in the next two bits.    This produces a run length coding word having a width of 16 bits,    which is illustrated at the penultimate position in FIG. 3.

The fifth rule for run length coding reads as follows:

-   5. If the same type of pixels runs right to the end of the line,    then a 0 is entered in the first 14 bit positions and the type of    following pixels is entered in the last two bit positions. This    again produces a run length coding word having a width of 16 bits,    which is regarded as a unit. This word is illustrated in the last    part of FIG. 3.

The sixth rule for run length coding reads as follows:

-   6. If, on the basis of the run length coding, no integral byte    division of the run length coding words is possible for the entire    line, then, at the end of the line, four 0's are entered in the last    bit positions.

The following is also used as the last rule for run length coding:

-   7. The quantity of run length-coded data within a line shall    correspond to 1440 bits or less.

Given simple picture contents, a large degree of compression is achievedby the run length coding. On the other hand, however, it has the effectthat the defined positions of specific pixels in the picture can nolonger be identified as easily in the associated data field 21 or 22 ofthe picture on account of the run length coding words having differentlengths, which words can apply to different numbers of pixels.

The invention is intended to enable replacement of individual pictureareas of the sub-picture by other picture patterns. In order to achievethis, a modified form of the run length coding is employed. The runlength coding method according to the invention likewise complies withthe above-described rules of run length coding, but the freedom ofpermitting in some instances non-optimized run length codes forexchangeable picture areas is utilized. This results in run length codeshaving a defined length for the picture areas to be exchanged, which canthen be exchanged more easily. This procedure is explained in moredetail with reference to FIG. 4.

In the case of the examples in FIG. 4, it is assumed that all of theexchangeable parts are printable characters which can be represented bythe illustrated matrix of 6×7 pixels. What is involved, then, is arectangular picture area that is to be exchanged. The printablecharacters 0, 1, 2, H are illustrated by way of example. Asterisksrepresent respective pixels that are to be coded as a foreground pixel,and dots represent the background pixels. The form in which the runlength coding is to be carried out for each line of the printablecharacters is in each case specified on the right next to the respectiveline. The resulting data bytes for the run length code are then in eachcase specified in hexadecimal notation at the right-hand edge of thefigure. It is clearly evident in the examples that two data bytes forthe run length code are produced for each line of the respective writingcharacter. This is independent of the respective content of the line.The fourth line with the printable character H is considered as anexample. Instead of the optimized run length coding word 19H inhexadecimal notation corresponding to the fact that six foregroundpixels follow one another, the run length coding is effected as if aforeground pixel followed a nearest foreground pixel. This is in turnfollowed by a further foreground pixel and the latter in turn by threefurther foreground pixels. As a result, the two hexadecimal data words55H and 5DH are then produced. In other words, two data bytes are againproduced for this line, as in the remaining lines, too. The abbreviation1×PP denotes that one foreground pixel follows; correspondinglyPP=Pattern Pixel. The abbreviation 4×BP stands for four successivebackground pixels; correspondingly BP=Background Pixel.

The further examples are illustrated in a self-explanatory manner inFIG. 4 and do not need to be individually explained in more detail here.What is essential is that run length coding is always effected such thatthe resulting run length coding words for each line have a number of 16bits, so that two bytes of memory space are required therefor.

The replacement of parts of the compressed pixel data area isillustrated in more detail in FIG. 5. The assumption here is that thememory address at which the replaceable area starts is known for eachline of the sub-picture unit. The control unit which performs thereplacement must therefore be programmed from the outset in such a waythat it retrieves the replaceable parts in the memory. In FIG. 5, thereference number 40 designates a first replaceable area. The numbersillustrated correspond to the hexadecimal numbers which have been chosenfor the run length coding of the writing character 0 in accordance withFIG. 4. The reference number 41 now corresponds to a second replaceablearea. The hexadecimal numbers for the representation of the writingcharacter 1 in accordance with FIG. 4 are specified in this area. Thesenumbers can now be replaced, as illustrated in the lower part of FIG. 5,for example by the numbers which represent the writing character 2. Thefurther hexadecimal numbers illustrated specify run length codes for therepresentation of the edge areas of the sub-picture. The associated runlength codes must in this case be chosen in such a way that each time anumber of data bytes is produced such that a distinct boundary withrespect to the exchangeable areas is produced.

The device which performs the replacement is explained below withreference to FIG. 6. In FIG. 6, the reference number 50 designates asub-picture decoding device. This may be a commercially availablesub-picture decoding device as described e.g. in the DVD standard(Version 1.0). The reference number 51 designates a first memory device;this memory device is represented for example by a volatile memory(RAM). The sub-picture units (SPU) which are to be decoded by thesub-picture decoding device 50 are stored in the said memory. The memorydevice 51 may also be part of the sub-picture decoding device 50; it isthen integrated in the sub-picture decoding device 50. In the presentcase, however, this memory device is provided as an external componentto the said sub-picture decoding device. The reference number 52designates a control unit. This may be a commercially availablemicrocomputer, for example. The control unit 52 serves to perform thereplacement of parts of a sub-picture, as described above. For thispurpose, it accesses the first memory unit 51 via thedata/address/control bus 55. The method of operation of the control unit52 will be explained in even more detail below. The reference number 53designates a second memory device. Stored therein is a table which, forall possible printable writing characters, has the associatedhexadecimal numbers for the run length-coded pixel data. Thecorresponding hexadecimal numbers for various writing characters wereportrayed in FIG. 4. These associated hexadecimal numbers are located inthe table of the memory device 53. The memory device 53 can be designedfor example as a non-volatile memory (EPROM). All of the components50-53 are connected to one another via the data/address/control bus 55.

The reference symbol 54 designates a keypad unit. Only the keys for the10 numbers 0-9 are illustrated. It is possible, of course, to providestill further keys on the keypad device. The keypad device 54 isconnected to the control unit 52 via a data bus 56.

The reference symbol 57 designates input lines which lead to thesub-picture decoding device 50, on the one hand, and to the control unit52, on the other hand. A field sync signal is transmitted via theseinput lines. Using this signal, the connected units identify which fieldis currently activated and consequently being displayed on the screen ofthe television receiver.

The method of operation of the control unit 52 is explained in moredetail below with reference to the flow diagram in FIG. 7. The flowdiagram serves the purpose of replacement of a sub-area of a sub-pictureunit which is located in the first memory device 51. The referencenumber 60 designates the program start. In interrogation 61, the controlunit 52 checks whether one of the numbers on the keypad device 54 hasbeen pressed for a new programme location selection for the televisionset. If not, the program waits until such a switch-over operation isidentified. As an alternative, the interrogation 61 may also be designedas an interrupt. If a new programme location selection has beenidentified, then in program step 62 selection of the associatedhexadecimal numbers for the respective number to be replaced ensues in amanner corresponding to the new programme location. First of all, thehexadecimal numbers for the first field are accepted into the controlunit 52. Then, in interrogation 63, an interrogation is carried out inwhich a check is made to see whether the signal bit BF in the memorylocation 49 in the flag register 58 of the control unit 52 is set due tothe arrival of the corresponding field sync signal via the input line57. If that is not the case, then the program continues to wait for thesetting of this signal bit. As soon as the signal bit for the secondfield is set, the program moves on to program step 64. The replacementof the hexadecimal numbers for the new programme location selection thentakes place in program step 64. For this purpose, the control unit 52accesses the first memory device 51. In this case, the control unit 52is programmed in such a way that it replaces exactly the correct memorylocations with the values which have been taken from the table in thesecond memory device 53. Afterwards, in program step 65, the controlunit 52 accepts the associated hexadecimal numbers for the second fieldfrom the table in the second memory device 53. Subsequently, ininterrogation 66, a check is made to see whether the signal bit TF inmemory location 59 of the flag register 58 for the first field isalready set. The program waits in a loop until this signal bit TF isset. If this signal bit TF has been set on account of the field syncsignal, then the replacement of the corresponding hexadecimal numbers inthe first memory device 51 takes place as the next program step 67. Forthis purpose, the control unit 52 again accesses the memory. On thebasis of the knowledge as to which sub picture unit is being processedby the sub-picture decoding device 50, the control unit 52 is againprogrammed automatically in such a way that the correct hexadecimalvalues are replaced. The programme is then ended in program step 68. Thereplacement of data in the pixel data area therefore always takes placeprecisely in the inactive field, thereby reliably avoiding accessconflict to the memory and/or a mixed display of writing characters onthe screen.

The method described here is suitable for exchanging parts of asub-picture to be displayed within the compressed pixel data area. As aresult, the field of application of the sub-picture decoding device isextended. Specifically, the sub-picture decoding device can then also beused for example for display menus which simplify operation of thecorresponding device. Such display menus are also referred to ason-screen displays. The replacement of individual writing characters bythe operator is possible in a simple manner. The insertion of individualtext characters also becomes possible because the insertion positions inthe compressed pixel data can easily be recognized on account of thespecial run length coding employed here. A complicated image processingunit with a frame store can consequently be dispensed with.

A variety of modifications of the exemplary embodiments described hereare possible and should also be regarded as being within the scope ofthe invention. Thus, for example, the area to be exchanged does notnecessarily have to have the shape of a rectangle. It is also possibleto exchange any desired other shape, formed by pixels. However, for eachline it is then necessary always to produce a fixed number of data bytesfor the run length code in order that exchange becomes possible. Themost complicated writing character, which is also intended to beauthorized to replace other writing characters, ultimately determineshow many data bytes have to be allocated in each case for the run lengthcode. This then governs how the individual lines of all the writingcharacters are to be coded. The method can also be used when overlappingpixel data areas (PXD) are permitted e.g. for scrolling. However, itmust then be ensured that the respective pixel data areas to be altereddo not belong to the overlapping areas.

Of course, the replaceable area does not necessarily have to be awriting character. Graphics characters or other graphical elements of apicture can also be exchanged in the same way.

1. Method for replacing parts of a digitally coded picture, the methodcomprising the following steps: a) run length-coding each line of thepicture wherein each replaceable part of a line of the picture is runlength-coded separately; b) run length-coding the part which replacesthe replaceable, original part of the line of the picture such that theassociated run length coding words take up the same number of data unitsas the run length coding words of the original part of this line of thepicture; and c) replacing the data for the run length coding words in amemory device.
 2. Method according to claim 1, wherein the digitallycoded picture is a sub-picture and further comprising the step ofdisplaying the digitally coded picture on the screen of a displaydevice.
 3. Method according to claim 2, further comprising the step ofholding the digitally coded picture in the form of two fields,interleaved in one another, each having half the number of lines in thememory device.
 4. Method according to claim 3, further comprising thesteps of signaling the field which is being respectively decoded, andallowing replacement of parts of the lines only in that field which iscurrently not being decoded.
 5. Method according to claim 1, furthercomprising the step of holding the digitally coded picture in the formof two fields, interleaved in one another, each having half the numberof lines in the memory device.
 6. Method according to claim 5, furthercomprising the steps of signaling the field which is being respectivelydecoded, and allowing replacement of parts of the lines only in thatfield which is currently not being decoded.
 7. Device for replacingparts of a digitally coded picture, comprising: a) a first memorydevice, in which run length coding words of lines of a picture can bestored, each replaceable part of a line of the picture being runlength-coded separately, b) a second memory device, in which the runlength coding words of the correspondingly run length-coded parts of thelines of the picture for the replacement of the replaceable parts of thelines can be stored, c) a control unit, which performs the replacementof the replaceable parts of the lines of the picture which are stored inthe first memory device.
 8. Device according to claim 7, in which thefirst memory device has separate memory areas for two fields of thepicture which are interleaved in one another, and the second memorydevice has separate memory areas for the corresponding parts of thefields which are interleaved in one another.
 9. Device according toclaim 8, comprising a signaling device, which indicates which field ofthe picture (11) is currently being decoded.
 10. Device according toclaim 9, comprising control means, which prevent replacement of thereplaceable parts of the lines of that field which is marked by thesignaling device as being currently subjected to the decoding operation.11. A machine readable storage device, in particular an optical disc,having recorded thereon a sub-picture unit for displaying sub-pictureswhen played back in a play back device, wherein the sub-picture unitincludes the following: a sub-picture unit header, a pixel data field, adisplay control sequence table, wherein each line of the sub-picture isrun length coded, and run length-coded pixel data is contained in thepixel data field, a sub-picture line is divided into a number ofreplaceable parts and the pixel data field contains a number ofseparately run-length-coded data fields for each replaceable part of theline.
 12. The machine readable storage device according to claim 11,wherein each replaceable part of a line of the sub-picture is runlength-coded separately to allow replacement of a replaceable part withrun length coding words that take up the same number of data units asthe run length coding words of the original part of this line of thesub-picture.
 13. Method for digitally coding a picture, the methodcomprising the following steps: dividing the lines of the picture into anumber of replaceable parts, run-length coding each line of the picturewherein each replaceable part of a line of the picture is runlength-coded separately to allow replacement of the replaceable partwith run length coding words that take up the same number of data unitsas the run length coding words of the original part of this line of thepicture.
 14. Method according to claim 13, wherein the picture is asub-picture that can be displayed on a display device in addition to amain picture.